#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
    vector<int> twoSum(vector<int>& nums, int target) {
    	vector<int> v;
    	map<int,int> mp;
		for(int i=0;i<nums.size();i++){
			if(mp.find(target-nums[i])!=mp.end()){
				v.push_back(mp[target-nums[i]]);
				v.push_back(i);	
				return v;
			}
			mp[nums[i]]=i;
		}
		return v;
    }
};
int main(){
	Solution a;
	vector<int> v;
	v.push_back(3);
	v.push_back(2);
	v.push_back(4);
	a.twoSum(v,6);
}


